﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Reviewer.Entities
{
    [DataContract(Namespace = "Reviewer.Entities")]
    public sealed class FrontPagePostImage : IExtensibleDataObject
    {
        public static bool operator ==(FrontPagePostImage item1, FrontPagePostImage item2)
        {
            // If both are null, or both are same instance, return true.
            if (System.Object.ReferenceEquals(item1, item2))
            {
                return true;
            }

            // If one is null, but not both, return false.
            if (((object)item1 == null) || ((object)item2 == null))
            {
                return false;
            }

            return item1.Equals(item2);
        }

        public static bool operator !=(FrontPagePostImage item1, FrontPagePostImage item2)
        {
            return !(item1 == item2);
        }

        [DataMember(IsRequired = true)]
        public int Id { get; set; }
        [DataMember(IsRequired = true)]
        public String FileName { get; set; }
        [DataMember]
        public String Tags { get; set; }

        public override bool Equals(object obj)
        {
            FrontPagePostImage second = obj as FrontPagePostImage;
            if (second != null)
            {
                return this.Id.Equals(second.Id)
                    && this.FileName.Equals(second.FileName)
                    && this.Tags.Equals(second.Tags)
                    ;
            }
            return false;
        }

        public override int GetHashCode()
        {
            return this.Id.GetHashCode();
        }

        #region IExtensibleDataObject Members
        ExtensionDataObject IExtensibleDataObject.ExtensionData { get; set; }
        #endregion
    }
}
